package com.ccc.dingtalk.mapper;

import com.ccc.dingtalk.pojo.db.Header;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author superC
 * @version 2.0.0
 * @date 2023/8/13
 */

@Mapper
public interface HeaderMapper extends BaseMapper<Header> {

    @Select(value = "select * from header")
    List<Header> findAll();

    @Insert("INSERT INTO header(id, tab, company, subcompany, subtitle) VALUES(#{id}, #{tab}, #{company}, #{subcompany}, #{subtitle})")
    void insert(Header title);

    @Update("UPDATE header SET tab = #{tab}, company = #{company}, subtitle = #{subtitle}, subtitle = #{subtitle} WHERE id = #{id}")
    void update(Header title);

    @Delete("DELETE FROM header WHERE id = #{id}")
    void delete(Long id);
}
